package com.cw.jeeyt.dao.impl.git;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.cw.jeeyt.common.Order;
import com.cw.jeeyt.dao.intf.git.GitSendEmailRecordDao;
import com.cw.jeeyt.dao.mapper.git.GitSendEmailRecordMapper;
import com.cw.jeeyt.dao.model.git.GitSendEmailRecordDo;
import com.cw.lang.common.utils.PageUtil;
import com.cw.lang.common.pagehelper.PageHelper;
import com.cw.lang.mybatis.dto.PageInfo;

/**
 * 邮件发送通知记录 dao数据库操作接口
 *
 * @author chenw
 * @date 2019-02-25 00:48:07
 */
@Repository
public class GitSendEmailRecordDaoImpl implements GitSendEmailRecordDao {
    @Autowired
    private GitSendEmailRecordMapper gitSendEmailRecordMapper;

    /**
     * 新增邮件发送通知记录
     *
     * @param gitSendEmailRecord
     * @return 整数
     */
    public Integer insert(GitSendEmailRecordDo gitSendEmailRecord) {
        return gitSendEmailRecordMapper.insert(gitSendEmailRecord);
    }

    /**
     * 新增邮件发送通知记录不为空的字段
     *
     * @param gitSendEmailRecord
     * @return 整数
     */
    public Integer insertSelective(GitSendEmailRecordDo gitSendEmailRecord) {
        return gitSendEmailRecordMapper.insertSelective(gitSendEmailRecord);
    }

    /**
     * 删除邮件发送通知记录
     *
     * @param gitSendEmailRecord
     */
    public void delete(GitSendEmailRecordDo gitSendEmailRecord) {
        gitSendEmailRecordMapper.delete(gitSendEmailRecord);
    }

    /**
     * 修改邮件发送通知记录不为null的字段
     *
     * @param gitSendEmailRecord
     */
    public void updateSelective(GitSendEmailRecordDo gitSendEmailRecord) {
        gitSendEmailRecordMapper.updateSelective(gitSendEmailRecord);
    }

    /**
     * 修改邮件发送通知记录
     *
     * @param gitSendEmailRecord
     */
    public void update(GitSendEmailRecordDo gitSendEmailRecord) {
        gitSendEmailRecordMapper.update(gitSendEmailRecord);
    }

    /**
     * 根据主键查询邮件发送通知记录
     *
     * @return 邮件发送通知记录
     */
    public GitSendEmailRecordDo getById(Long recordId) {
        return getById(recordId);
    }

    /**
     * 查询所有邮件发送通知记录
     *
     * @return 邮件发送通知记录集合
     */
    public List<GitSendEmailRecordDo> queryGitSendEmailRecordList() {
        return gitSendEmailRecordMapper.queryGitSendEmailRecordList();
    }

    /**
     * 分页查询邮件发送通知记录
     *
     * @param gitSendEmailRecord 查询条件
     * @param startNum 开始条数
     * @param pageSize 每页长度
     * @return 邮件发送通知记录集合
     */
    public PageInfo<GitSendEmailRecordDo> queryByPage(GitSendEmailRecordDo gitSendEmailRecord, Integer startNum,
        Integer pageSize, Order order) {
        PageHelper.startPage(PageUtil.calPageNum(startNum, pageSize), pageSize);
        return new PageInfo<>(gitSendEmailRecordMapper.queryByPage(gitSendEmailRecord, order));
    }
}
